﻿<?php
include_once("../../includes/metodos.php");
include_once("action.php");

checkUser();
connectSql();
isAdmin();
include_once("../cabecalho.php");

if(!empty($_POST['cmd']) && $_POST['cmd']=='edit'){
	edit(anti_injection($_POST['id']));
}

connectSql();
$query = mysql_query("SELECT * FROM econ_multimidia WHERE id=".anti_injection($_REQUEST['id']));
$row = mysql_fetch_array($query);
?>
<div id="conteudo_mult"><br>
  <div style="width:306px; height:auto; margin:0 auto;padding:0 0 0 0;"><br>
	<form action="edit.php" method="post">
		<label id="txt_multimidia_new">Titulo:</label>
		<input id="input_mult_titulo" type="text" name="titulo" value="<?php echo $row['titulo'];?>"/><br/>
		<label id="txt_multimidia_new">Link:</label>
		<input id="input_mult_titulo2" type="text" name="link" value="<?php echo $row['link'];?>"/><br/>
		<label id="status_mult">Status</label><br/>
		<?php 
			if($row['status']==1){
				echo '<input id="radio_mult1" type="radio" name="status" value="1" checked="checked"><label id="radio_mult3">Ativo</label><br/>';
				echo '<input id="radio_mult1" type="radio" name="status" value="2"><label id="radio_mult2">Inativo</label><br/>';
			}else{
				echo '<input id="radio_mult1" type="radio" name="status" value="1"><label id="radio_mult3">Ativo</label><br/>';
				echo '<input id="radio_mult1" type="radio" name="status" value="2"checked="checked"><label id="radio_mult2">Inativo</label>';
			}
		?>
		<label id="txt_multimidia_new">Descricao</label>
		<input style="float:right; border: 1px solid #009900;border-radius: 5px; width:218px;" type="text" name="descricao" value="<?php echo $row['descricao'];?>"/><br/>
		<label id="txt_multimidia_new">Assuntos Relacionados</label>
		<input style="float:right;border: 1px solid #009900;border-radius: 5px;" type="text" name="tags" value="<?php echo $row['tags'];?>"/><br/>
		<input type="hidden" name="cmd" value="edit"/>
		<input type="hidden" name="id" value="<?php echo anti_injection($_REQUEST['id']);?>"><br><br>
		<input id="btn_salva_mult" type="submit" value="Salvar">
	</form>
  </div>
</div>